<template>
<Card>
    <Tabs v-model="name" :animated="false">
        <TabPane name="1" :label="'全部('+totallist.all_num+')'">
            <patient ref="patient" @alltotal="alltotal" v-show="+name===1" v-if="+edit_type === 2"/>
            <patientAssistant ref="patientAssistant" @alltotal="alltotal" :labelList="labelList" v-show="+name===1" v-if="+edit_type === 1"/>
        </TabPane>
        <TabPane name="2" :label="'已到('+totallist.arrive_num+')'">
            <arrive ref="arrive" @alltotal="alltotal" :edit_type='edit_type' v-show="+name===2"/>
        </TabPane>
        <TabPane name="3" :label="'预到('+totallist.order_arrive_num+')'">
            <orderArrive ref="orderArrive" @alltotal="alltotal" :edit_type='edit_type' v-show="+name===3"/>
        </TabPane>
        <TabPane name="4" :label="'过期未到('+totallist.unarrive_num+')'">
            <unarrive ref="unarrive" @alltotal="alltotal" :edit_type='edit_type' v-show="+name===4"/>
        </TabPane>
    </Tabs>
</Card>
</template>
<script>
    import patientAssistant from './patientAssistant';
    import patient from './patient';
    import arrive from './arrive';
    import orderArrive from './orderArrive';
    import unarrive from './unarrive';
    export default {
        components: { patientAssistant, patient, arrive, orderArrive, unarrive },
        props: ['edit_type'],
        data() {
            return {
                name: '1',
                totallist: {
                    all_num: 0,
                    arrive_num: 0,
                    order_arrive_num: 0,
                    unarrive_num: 0
                },
                typeList: [],
                labelList: [],
            }
        },
        methods: {
            alltotal(e){
                if (e.num === 1) {
                    this.totallist.all_num = e.total
                } else if (e.num === 2) {
                    this.totallist.arrive_num = e.total
                } else if (e.num === 3) {
                    this.totallist.order_arrive_num = e.total
                } else if (e.num === 4) {
                    this.totallist.unarrive_num = e.total
                }
            },
            List(e) {
                this.typeList = e.typeList
                this.labelList = e.labelList
            }
        },
    }
</script>
